package com.da.javatest.leetCode;

/**
 * @author chenlida
 * @date 2018/12/14 10:25
 * @description
 */
public class Code905 {
    public int[] sortArrayByParity(int[] A) {
        int[] result = new int[A.length];
        int start = 0;
        int end = A.length - 1;
        for (int i : A) {
            if (i % 2 == 0) {
                result[start++] = i;
            } else {
                result[end--] = i;
            }
        }
        return result;
    }
}
